<?php
/**
 * Created by IDEA.
 * User: dinesh
 * Date: Feb 25, 2012
 * Time: 11:41:53 AM
 * To change this template use File | Settings | File Templates.
 */
  Class CmbBaseConfig{
     private static $_coreClasses=array(
		//'CApplication' => '/base/CApplication.php',
		//'CApplicationComponent' => '/base/CApplicationComponent.php',

         );
     private static $_coreConfig=array();

     public static function getConfig($key){
              return self::$_coreConfig[$key];
      }
      public static function getInstance($config=null){
          self::$_coreConfig = require($config);
         // print_r(self::$_coreConfig);

      }

     public static function autoload($className)
	 {
		if(isset(self::$_coreClasses[$className]))
			include_once(SERVER_ROOT.self::$_coreClasses[$className]);
		foreach(self::$_coreConfig['import'] as $path) {
            $file = SERVER_ROOT .$path .DIRECTORY_SEPARATOR. $className . '.php';
            if (file_exists($file))
            {
                 include_once($file);
            }
            
        }
     }
            
  }
 
spl_autoload_register(array('CmbBaseConfig','autoload'));